<%@ page contentType="text/html; charset=utf-8"%>
<%@ include file="../../header.jsp"%>
<link rel="stylesheet" type="text/css" href="${ctx }/webuploader/style.css">
<link rel="stylesheet" type="text/css" href="${ctx }/webuploader/webuploader.css">
<link rel="stylesheet" type="text/css" href="${ctx }/bootstrap/css/bootstrap-datetimepicker.css">
<!--引入JS-->
<script type="text/javascript" src="${ctx }/webuploader/webuploader.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctx }/bootstrap/js/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" charset="utf-8" src="${ctx }/bootstrap/js/bootstrap-datetimepicker.fr.js"></script>
<script type="text/javascript" src="${ctx }/views/video/video.js"></script>
<script type="text/javascript" src="${ctx }/plupload/plupload.full.min.js"></script>
<script type="text/javascript" src="${ctx }/qiniu/ui.js"></script>
<script type="text/javascript" src="${ctx }/qiniu/qiniu.js"></script>
<script type="text/javascript" src="${ctx }/qiniu/highlight.js"></script>
<script type="text/javascript" src="${ctx }/qiniu/main.js"></script>
<script type="text/javascript">hljs.initHighlightingOnLoad();</script>
<meta charset="UTF-8" />
<style>
	.user_temp{
	display: none;
	}
</style>
<div class="container">
	<div class="panel panel-info">
   <div class="panel-heading">
      <h3 class="panel-title">上传视频</h3>
   </div>
    <div class="panel-body">
		<form class="form-horizontal" action="${ctx }/post/addPost" id="defaultForm" method="post">
		<div class="form-group">
						<label for="firstname" class="col-sm-2 control-label">显示时间:</label>
						<div class="col-sm-5">
							<input type="text" class="form-control" name="showtime" readonly 
							 id="datetimepicker" placeholder="设置定时显示日期" data-date-format="yyyy-mm-dd hh:ii:ss">
						</div>
						<div>
						</div>
		</div>
		<div class="form-group">
						<label for="firstname" class="col-sm-2 control-label">发帖人：</label>
						<div class="col-sm-2">
						  <select class="form-control" id="usertype">
								<option value="0">网红</option>
								<option value="1">小号</option>
							</select>
						</div>
						<div class="col-sm-3 internet_red">
							<select class="form-control" name="user_red" id="user_red">
							<option value="">----选择下面网红----</option>
								<c:forEach var="user" items="${users_red }">
									<option value="${user.customerId }">${user.firstName }</option>
								</c:forEach>
							</select>
						</div>
						<div class="col-sm-3 user_temp">
							<select class="form-control" name="user_tmp" id="user_tmp">
							<option value="">----选择下面小号----</option>
								<c:forEach var="user" items="${users_tmp }">
									<option value="${user.customerId }">${user.firstName }</option>
								</c:forEach>
							</select>
						</div>
						
		</div>
		<div class="form-group">
						<label for="firstname" class="col-sm-2 control-label">标签:</label>
						<div class="col-sm-10">
							<select size="10" multiple class="form-control" name="label">
								<c:forEach var="bean" items="${labelList }">
										<option value="${bean.id }" >${bean.labelName }</option>
								</c:forEach>
							</select>
						</div>
					</div>
		  <div class="form-group">
						<label for="firstname" class="col-sm-2 control-label">视频标题：</label>
						<div class="col-sm-10">
							<input type="text" class="form-control" name="title" placeholder="请输入标题">
							<input type="hidden" name="key" id="key"/>
							 <input type="hidden" name="postType" value="2"/>
						</div>
			</div>
		  <div class="form-group">
						<label for="firstname" class="col-sm-2 control-label">视频描述：</label>
						<div class="col-sm-10">
							<textarea class="form-control" rows="8" name="description"></textarea>
						</div>
			</div>
			 <div class="form-group row">
						<label for="firstname" class="col-sm-2 control-label">视频：</label>
						<div class="col-sm-3">
						   <div id="container">
                            <a class="btn btn-default btn-lg " id="pickfiles" href="#" >
                                <i class="glyphicon glyphicon-plus"></i>
                                <span>选择文件</span>
                            </a>
                        </div>
                         </div>
                    <div class="col-sm-7">
                        	<!--   <div style="display:none" id="success" class="col-md-12">
                       		 	<div class="alert-success">   队列全部文件处理完毕  </div>
                    			</div> -->
                    
                        <table class="table table-striped table-hover text-left" style="display: none;">
                            <thead>
                              <tr>
                                <th class="col-md-4">Filename</th>
                                <th class="col-md-2">Size</th>
                                <th class="col-md-6">Detail</th>
                              </tr>
                            </thead>
                            <tbody id="fsUploadProgress">
                            </tbody>
                        </table>
                    
						</div>
			</div>
			<div class="form-group">
						 <!--用来存放item-->
						<label for="firstname" class="col-sm-2 control-label">视频封面：</label>
						<div class="col-sm-10">
						    <div id="fileList" class="uploader-list"></div>
						     <input type="hidden" class="form-control" name="conver" id="conver"/>
						   <div id="filePicker">选择图片</div>
						</div>
					 </div>
		 <div class="form-group">
						<div class="col-sm-offset-2 col-sm-10">
							<button type="submit" class="btn btn-info">发布</button>
						</div>
					</div>
		</form>
   </div>
</div>
</div>
<script>
var uptoken = '${uptoken}';
$('#datetimepicker').datetimepicker({
	format: 'yyyy-mm-dd hh:ii:ss',
	autoclose: true,
    todayBtn: true,
    pickerPosition: "bottom-left"
});
$(".mkbanner >li:eq(0)").addClass("active");
$("#usertype").change(function(){
	if($("#usertype").val() == 1){
		$(".user_temp").show();
		$(".internet_red").hide();
		$("#user_red").val("");
	}else{
		$(".internet_red").show();
		$(".user_temp").hide();
		$("#user_tmp").val("");
	}
});
</script>